﻿using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;

namespace OledTestApp
{
    public partial class Program
    {
        GTM.Seeed.OledDisplay display;

        void ProgramStarted()
        {
            /******************************************************************************************
            Access modules defined in the designer by typing their name:                            
            
            e.g.  button
                  camera1

            Initialize event handlers here.
            e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);             
            ***************************************************************************************** */
            display = new GTM.Seeed.OledDisplay(6);

            TestSimpleGraphics();
            //TestWPF();

            // Do one-time tasks here
            Debug.Print("Program Started");
        }

        void TestSimpleGraphics()
        {
            display.SimpleGraphics.DisplayEllipse(GT.Color.Blue, 50, 50, 30, 30);
            display.SimpleGraphics.DisplayText("Hello", Resources.GetFont(Resources.FontResources.NinaB), GT.Color.Red, 30, 30);
        }

        Window window;
        Canvas canvas;
        Text text;

        void TestWPF()
        {
            window = display.WPFWindow;
            canvas = new Canvas();
            text = new Text(Resources.GetFont(Resources.FontResources.NinaB), "Hi WPF");
            canvas.Children.Add(text);
            Canvas.SetLeft(text, 20);
            Canvas.SetTop(text, 20);
            window.Child = canvas;
        }
    }
}
